home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10843 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: watnews.watson.ibm.com!ncohen
  2. From: ncohen@watson.ibm.com (Norman H. Cohen)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 11 Mar 1996 14:40:14 GMT
  6. Organization: IBM T.J. Watson Research Center
  7. Distribution: world
  8. Message-ID: <4i1e0e$1716@watnews1.watson.ibm.com>
  9. References: <4h5hgj$vpd@tomquartz.niestu.com> <4h7jskINNnph@anvil.ugrad.cs.ubc.ca> <313EDF38.61C1@lfwc.lockheed.com> <DnyCz1.A1n@research.att.com>
  10. Reply-To: ncohen@watson.ibm.com
  11. NNTP-Posting-Host: rios8.watson.ibm.com
  12.  
  13. In article <DnyCz1.A1n@research.att.com>, ark@research.att.com
  14. (Andrew Koenig) says of the C standard: 
  15.  
  16. ...
  17. |>              It defines what a range error is, then leaves it up to the
  18. |> implementation to check for it or not.  Most, but not all, C implementations
  19. |> don't bother to check, partly because checking is expensive at run time.
  20.  
  21. And partly because there is too much production C code out there that
  22. would fail these checks.
  23.  
  24. In some cases the violation of the ANSI rules is deliberate.  Either the
  25. programmer did not know that what he was doing violated the ANSI rules,
  26. or he knew but he didn't care, because it worked with the compiler he was
  27. using.
  28.  
  29. In some cases the violation of the ANSI rules is accidental.  The
  30. programmer does not intend to index an array out of bounds but does so by
  31. mistake and is not caught.  Nonetheless, the program SEEMS to work, and
  32. the programmer would consider it a disservice if the implementation were
  33. "improved" to catch the error, since this would appear to break a program
  34. that had been working.
  35.  
  36. --
  37. Norman H. Cohen    ncohen@watson.ibm.com
  38.